/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Formulario_Ventas.java
 *
 * Created on 8/06/2011, 08:46:03 PM
 */
package restaurante;

/**
 *
 * @author Jito
 */
public class Formulario_Ventas extends javax.swing.JFrame {

    /** Creates new form Formulario_Ventas */
    public Formulario_Ventas() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        P_Datos_Cliente = new javax.swing.JPanel();
        P_Total = new javax.swing.JPanel();
        L_Total = new javax.swing.JLabel();
        L_Totales = new javax.swing.JLabel();
        L_NIT = new javax.swing.JLabel();
        Combo_NIT = new javax.swing.JComboBox();
        L_NombreCliente = new javax.swing.JLabel();
        L_ApellidoCliente = new javax.swing.JLabel();
        L_direccion = new javax.swing.JLabel();
        I_nombreCliente = new javax.swing.JTextField();
        I_ApelldoCliente = new javax.swing.JTextField();
        I_Direccion = new javax.swing.JTextField();
        L_NoFactura = new javax.swing.JLabel();
        L_NoF = new javax.swing.JLabel();
        B_Nuevo_Cliente = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        Tabla_Venta = new javax.swing.JTable();
        B_Aceptar_Factura = new javax.swing.JButton();
        B_CancelarFactura = new javax.swing.JButton();
        L_FacturaDeVenta = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(restaurante.RestauranteApp.class).getContext().getResourceMap(Formulario_Ventas.class);
        P_Datos_Cliente.setBackground(resourceMap.getColor("P_Datos_Cliente.background")); // NOI18N
        P_Datos_Cliente.setName("P_Datos_Cliente"); // NOI18N

        P_Total.setBackground(resourceMap.getColor("P_Total.background")); // NOI18N
        P_Total.setForeground(resourceMap.getColor("P_Total.foreground")); // NOI18N
        P_Total.setName("P_Total"); // NOI18N

        L_Total.setFont(resourceMap.getFont("L_Total.font")); // NOI18N
        L_Total.setForeground(resourceMap.getColor("L_Total.foreground")); // NOI18N
        L_Total.setText(resourceMap.getString("L_Total.text")); // NOI18N
        L_Total.setName("L_Total"); // NOI18N

        L_Totales.setFont(resourceMap.getFont("L_Totales.font")); // NOI18N
        L_Totales.setForeground(resourceMap.getColor("L_Totales.foreground")); // NOI18N
        L_Totales.setText(resourceMap.getString("L_Totales.text")); // NOI18N
        L_Totales.setName("L_Totales"); // NOI18N

        javax.swing.GroupLayout P_TotalLayout = new javax.swing.GroupLayout(P_Total);
        P_Total.setLayout(P_TotalLayout);
        P_TotalLayout.setHorizontalGroup(
            P_TotalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P_TotalLayout.createSequentialGroup()
                .addGroup(P_TotalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(P_TotalLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(L_Total))
                    .addGroup(P_TotalLayout.createSequentialGroup()
                        .addGap(94, 94, 94)
                        .addComponent(L_Totales)))
                .addContainerGap(79, Short.MAX_VALUE))
        );
        P_TotalLayout.setVerticalGroup(
            P_TotalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P_TotalLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(L_Total)
                .addGap(46, 46, 46)
                .addComponent(L_Totales)
                .addContainerGap(29, Short.MAX_VALUE))
        );

        L_NIT.setText(resourceMap.getString("L_NIT.text")); // NOI18N
        L_NIT.setName("L_NIT"); // NOI18N

        Combo_NIT.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "C/F" }));
        Combo_NIT.setName("Combo_NIT"); // NOI18N

        L_NombreCliente.setText(resourceMap.getString("L_NombreCliente.text")); // NOI18N
        L_NombreCliente.setName("L_NombreCliente"); // NOI18N

        L_ApellidoCliente.setText(resourceMap.getString("L_ApellidoCliente.text")); // NOI18N
        L_ApellidoCliente.setName("L_ApellidoCliente"); // NOI18N

        L_direccion.setText(resourceMap.getString("L_direccion.text")); // NOI18N
        L_direccion.setName("L_direccion"); // NOI18N

        I_nombreCliente.setName("I_nombreCliente"); // NOI18N

        I_ApelldoCliente.setName("I_ApelldoCliente"); // NOI18N

        I_Direccion.setName("I_Direccion"); // NOI18N

        L_NoFactura.setFont(resourceMap.getFont("L_NoFactura.font")); // NOI18N
        L_NoFactura.setText(resourceMap.getString("L_NoFactura.text")); // NOI18N
        L_NoFactura.setName("L_NoFactura"); // NOI18N

        L_NoF.setFont(resourceMap.getFont("L_NoF.font")); // NOI18N
        L_NoF.setText(resourceMap.getString("L_NoF.text")); // NOI18N
        L_NoF.setName("L_NoF"); // NOI18N

        B_Nuevo_Cliente.setFont(resourceMap.getFont("B_Nuevo_Cliente.font")); // NOI18N
        B_Nuevo_Cliente.setIcon(resourceMap.getIcon("B_Nuevo_Cliente.icon")); // NOI18N
        B_Nuevo_Cliente.setText(resourceMap.getString("B_Nuevo_Cliente.text")); // NOI18N
        B_Nuevo_Cliente.setName("B_Nuevo_Cliente"); // NOI18N
        B_Nuevo_Cliente.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                B_Nuevo_ClienteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout P_Datos_ClienteLayout = new javax.swing.GroupLayout(P_Datos_Cliente);
        P_Datos_Cliente.setLayout(P_Datos_ClienteLayout);
        P_Datos_ClienteLayout.setHorizontalGroup(
            P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P_Datos_ClienteLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(P_Datos_ClienteLayout.createSequentialGroup()
                        .addComponent(L_NoFactura, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(L_NoF, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(276, 276, 276)
                        .addComponent(B_Nuevo_Cliente)
                        .addGap(62, 62, 62)
                        .addComponent(P_Total, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(261, 261, 261))
                    .addGroup(P_Datos_ClienteLayout.createSequentialGroup()
                        .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(L_direccion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(L_NIT, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(L_NombreCliente, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
                            .addComponent(L_ApellidoCliente))
                        .addGap(18, 18, 18)
                        .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(P_Datos_ClienteLayout.createSequentialGroup()
                                .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(I_ApelldoCliente, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 339, Short.MAX_VALUE)
                                    .addComponent(Combo_NIT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(I_nombreCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 302, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(127, 127, 127))
                            .addComponent(I_Direccion, javax.swing.GroupLayout.PREFERRED_SIZE, 439, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(583, 583, 583))))
        );
        P_Datos_ClienteLayout.setVerticalGroup(
            P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(P_Datos_ClienteLayout.createSequentialGroup()
                .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(P_Datos_ClienteLayout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(P_Total, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(P_Datos_ClienteLayout.createSequentialGroup()
                                .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(L_NoFactura, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(L_NoF))
                                .addGap(47, 47, 47)
                                .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(Combo_NIT, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(L_NIT))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(I_nombreCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(L_NombreCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(P_Datos_ClienteLayout.createSequentialGroup()
                                        .addGap(9, 9, 9)
                                        .addComponent(I_ApelldoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(P_Datos_ClienteLayout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(L_ApellidoCliente, javax.swing.GroupLayout.DEFAULT_SIZE, 18, Short.MAX_VALUE)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(P_Datos_ClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(L_direccion, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(I_Direccion, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, P_Datos_ClienteLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(B_Nuevo_Cliente)
                        .addGap(87, 87, 87)))
                .addGap(48, 48, 48))
        );

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        Tabla_Venta.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Codigo", "Cantidad", "Descripcion", "Total"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        Tabla_Venta.setName("Tabla_Venta"); // NOI18N
        jScrollPane1.setViewportView(Tabla_Venta);

        B_Aceptar_Factura.setIcon(resourceMap.getIcon("B_Aceptar_Factura.icon")); // NOI18N
        B_Aceptar_Factura.setText(resourceMap.getString("B_Aceptar_Factura.text")); // NOI18N
        B_Aceptar_Factura.setName("B_Aceptar_Factura"); // NOI18N

        B_CancelarFactura.setIcon(resourceMap.getIcon("B_CancelarFactura.icon")); // NOI18N
        B_CancelarFactura.setText(resourceMap.getString("B_CancelarFactura.text")); // NOI18N
        B_CancelarFactura.setName("B_CancelarFactura"); // NOI18N
        B_CancelarFactura.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                B_CancelarFacturaActionPerformed(evt);
            }
        });

        L_FacturaDeVenta.setFont(resourceMap.getFont("L_FacturaDeVenta.font")); // NOI18N
        L_FacturaDeVenta.setText(resourceMap.getString("L_FacturaDeVenta.text")); // NOI18N
        L_FacturaDeVenta.setName("L_FacturaDeVenta"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 885, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addGap(301, 301, 301)
                .addComponent(L_FacturaDeVenta)
                .addContainerGap(426, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(P_Datos_Cliente, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(646, Short.MAX_VALUE)
                .addComponent(B_CancelarFactura)
                .addGap(34, 34, 34)
                .addComponent(B_Aceptar_Factura)
                .addGap(23, 23, 23))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addComponent(L_FacturaDeVenta)
                .addGap(26, 26, 26)
                .addComponent(P_Datos_Cliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(102, 102, 102)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(61, 61, 61)
                        .addComponent(B_Aceptar_Factura))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(69, 69, 69)
                        .addComponent(B_CancelarFactura)))
                .addContainerGap(31, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void B_Nuevo_ClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_B_Nuevo_ClienteActionPerformed
        // TODO add your handling code here:
        Formulario_Clientes clientes = new Formulario_Clientes();
        clientes.setVisible(true);
    }//GEN-LAST:event_B_Nuevo_ClienteActionPerformed

    private void B_CancelarFacturaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_B_CancelarFacturaActionPerformed
        // TODO add your handling code here:
        Formulario_Ventas.this.setVisible(false);
        
    }//GEN-LAST:event_B_CancelarFacturaActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Formulario_Ventas().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton B_Aceptar_Factura;
    private javax.swing.JButton B_CancelarFactura;
    private javax.swing.JButton B_Nuevo_Cliente;
    private javax.swing.JComboBox Combo_NIT;
    private javax.swing.JTextField I_ApelldoCliente;
    private javax.swing.JTextField I_Direccion;
    private javax.swing.JTextField I_nombreCliente;
    private javax.swing.JLabel L_ApellidoCliente;
    private javax.swing.JLabel L_FacturaDeVenta;
    private javax.swing.JLabel L_NIT;
    private javax.swing.JLabel L_NoF;
    private javax.swing.JLabel L_NoFactura;
    private javax.swing.JLabel L_NombreCliente;
    private javax.swing.JLabel L_Total;
    private javax.swing.JLabel L_Totales;
    private javax.swing.JLabel L_direccion;
    private javax.swing.JPanel P_Datos_Cliente;
    private javax.swing.JPanel P_Total;
    private javax.swing.JTable Tabla_Venta;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
}
